<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>SDL_gfx: I:/Sources/sdlgfx/SDL_gfxBlitFunc.h File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">SDL_gfx
   &#160;<span id="projectnumber">2.0.25</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">I:/Sources/sdlgfx/SDL_gfxBlitFunc.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdio.h&gt;</code><br/>
<code>#include &lt;stdlib.h&gt;</code><br/>
<code>#include &quot;SDL.h&quot;</code><br/>
<code>#include &quot;SDL_video.h&quot;</code><br/>
</div>
<p><a href="_s_d_l__gfx_blit_func_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_s_d_l__gfx_blit_info.html">SDL_gfxBlitInfo</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The structure passed to the low level blit functions.  <a href="struct_s_d_l__gfx_blit_info.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr class="memitem:a8fcea397327309f4ab31a3251f15f911"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#a8fcea397327309f4ab31a3251f15f911">SDL_GFXBLITFUNC_SCOPE</a>&#160;&#160;&#160;extern</td></tr>
<tr class="memitem:ae6b2c815be86ad92310efb40d4b0b30e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#ae6b2c815be86ad92310efb40d4b0b30e">GFX_RGBA_FROM_PIXEL</a>(pixel, fmt, r, g, b, a)</td></tr>
<tr class="memdesc:ae6b2c815be86ad92310efb40d4b0b30e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unwrap RGBA values from a pixel using mask, shift and loss for surface.  <a href="#ae6b2c815be86ad92310efb40d4b0b30e"></a><br/></td></tr>
<tr class="memitem:a7dda3984ca04929e2ea0a3679f7452a9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#a7dda3984ca04929e2ea0a3679f7452a9">GFX_DISASSEMBLE_RGBA</a>(buf, bpp, fmt, pixel, r, g, b, a)</td></tr>
<tr class="memdesc:a7dda3984ca04929e2ea0a3679f7452a9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disassemble buffer pointer into a pixel and separate RGBA values.  <a href="#a7dda3984ca04929e2ea0a3679f7452a9"></a><br/></td></tr>
<tr class="memitem:a64927ca5690904716f7ac93b1fcd4420"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#a64927ca5690904716f7ac93b1fcd4420">GFX_PIXEL_FROM_RGBA</a>(pixel, fmt, r, g, b, a)</td></tr>
<tr class="memdesc:a64927ca5690904716f7ac93b1fcd4420"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wrap a pixel from RGBA values using mask, shift and loss for surface.  <a href="#a64927ca5690904716f7ac93b1fcd4420"></a><br/></td></tr>
<tr class="memitem:a4e59f926fb98a86c01a4ffc5cc20e8d5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#a4e59f926fb98a86c01a4ffc5cc20e8d5">GFX_ASSEMBLE_RGBA</a>(buf, bpp, fmt, r, g, b, a)</td></tr>
<tr class="memdesc:a4e59f926fb98a86c01a4ffc5cc20e8d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assemble pixel into buffer pointer from separate RGBA values.  <a href="#a4e59f926fb98a86c01a4ffc5cc20e8d5"></a><br/></td></tr>
<tr class="memitem:ae3efb9e67172838c394c148a62822da6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#ae3efb9e67172838c394c148a62822da6">GFX_ALPHA_BLEND</a>(sR, sG, sB, A, dR, dG, dB)</td></tr>
<tr class="memdesc:ae3efb9e67172838c394c148a62822da6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Blend the RGB values of two pixels based on a source alpha value.  <a href="#ae3efb9e67172838c394c148a62822da6"></a><br/></td></tr>
<tr class="memitem:a44c498dca765a515f40eecad8f19aac4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#a44c498dca765a515f40eecad8f19aac4">GFX_DUFFS_LOOP4</a>(pixel_copy_increment, width)</td></tr>
<tr class="memdesc:a44c498dca765a515f40eecad8f19aac4"><td class="mdescLeft">&#160;</td><td class="mdescRight">4-times unrolled DUFFs loop.  <a href="#a44c498dca765a515f40eecad8f19aac4"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ab49c560e89b8305051b2e6b347215f03"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#a8fcea397327309f4ab31a3251f15f911">SDL_GFXBLITFUNC_SCOPE</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#ab49c560e89b8305051b2e6b347215f03">SDL_gfxBlitRGBA</a> (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)</td></tr>
<tr class="memdesc:ab49c560e89b8305051b2e6b347215f03"><td class="mdescLeft">&#160;</td><td class="mdescRight">Blitter for RGBA-&gt;RGBA blits with alpha adjustment.  <a href="#ab49c560e89b8305051b2e6b347215f03"></a><br/></td></tr>
<tr class="memitem:a4627ae4a0037d0b248bed87f3c294735"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#a8fcea397327309f4ab31a3251f15f911">SDL_GFXBLITFUNC_SCOPE</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#a4627ae4a0037d0b248bed87f3c294735">SDL_gfxSetAlpha</a> (SDL_Surface *src, Uint8 a)</td></tr>
<tr class="memdesc:a4627ae4a0037d0b248bed87f3c294735"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the alpha channel in a 32 bit surface.  <a href="#a4627ae4a0037d0b248bed87f3c294735"></a><br/></td></tr>
<tr class="memitem:a7c93594525ae349b5cef0156b8f758fc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#a8fcea397327309f4ab31a3251f15f911">SDL_GFXBLITFUNC_SCOPE</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#a7c93594525ae349b5cef0156b8f758fc">SDL_gfxMultiplyAlpha</a> (SDL_Surface *src, Uint8 a)</td></tr>
<tr class="memdesc:a7c93594525ae349b5cef0156b8f758fc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply the alpha channel in a 32bit surface.  <a href="#a7c93594525ae349b5cef0156b8f758fc"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a6d0c17342154e14322a281603960691a"><td class="memItemLeft" align="right" valign="top">const unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#a6d0c17342154e14322a281603960691a">GFX_ALPHA_ADJUST_ARRAY</a> [256]</td></tr>
<tr class="memdesc:a6d0c17342154e14322a281603960691a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Alpha adjustment table for custom blitter.  <a href="#a6d0c17342154e14322a281603960691a"></a><br/></td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ae3efb9e67172838c394c148a62822da6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="_s_d_l__gfx_blit_func_8h.html#ae3efb9e67172838c394c148a62822da6">GFX_ALPHA_BLEND</a></td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">sR, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">sG, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">sB, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">A, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">dR, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">dG, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">dB&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> {                                            \
        dR = (((sR-dR)*(A))/255)+dR;            \
        dG = (((sG-dG)*(A))/255)+dG;            \
        dB = (((sB-dB)*(A))/255)+dB;            \
        } <span class="keywordflow">while</span>(0)
</pre></div>
<p>Blend the RGB values of two pixels based on a source alpha value. </p>

<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8h_source.html#l00138">138</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8h_source.html">SDL_gfxBlitFunc.h</a>.</p>

</div>
</div>
<a class="anchor" id="a4e59f926fb98a86c01a4ffc5cc20e8d5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="_s_d_l__gfx_blit_func_8h.html#a4e59f926fb98a86c01a4ffc5cc20e8d5">GFX_ASSEMBLE_RGBA</a></td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">buf, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">bpp, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">fmt, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">r, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">g, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{                                                                       \
        Uint32 pixel;                                   <a class="code" href="_s_d_l__gfx_blit_func_8h.html#a64927ca5690904716f7ac93b1fcd4420" title="Wrap a pixel from RGBA values using mask, shift and loss for surface.">\</a>
<a class="code" href="_s_d_l__gfx_blit_func_8h.html#a64927ca5690904716f7ac93b1fcd4420" title="Wrap a pixel from RGBA values using mask, shift and loss for surface.">	\</a>
<a class="code" href="_s_d_l__gfx_blit_func_8h.html#a64927ca5690904716f7ac93b1fcd4420" title="Wrap a pixel from RGBA values using mask, shift and loss for surface.">	GFX_PIXEL_FROM_RGBA</a>(pixel, fmt, r, g, b, a);   \
        *((Uint32 *)(buf)) = pixel;                     \
        }
</pre></div>
<p>Assemble pixel into buffer pointer from separate RGBA values. </p>

<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8h_source.html#l00127">127</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8h_source.html">SDL_gfxBlitFunc.h</a>.</p>

</div>
</div>
<a class="anchor" id="a7dda3984ca04929e2ea0a3679f7452a9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="_s_d_l__gfx_blit_func_8h.html#a7dda3984ca04929e2ea0a3679f7452a9">GFX_DISASSEMBLE_RGBA</a></td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">buf, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">bpp, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">fmt, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">pixel, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">r, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">g, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> {                                                                       \
        pixel = *((Uint32 *)(buf));                                        \
        GFX_RGBA_FROM_PIXEL(pixel, fmt, r, g, b, a);                       \
        pixel &amp;= ~fmt-&gt;Amask;                                              \
        } <span class="keywordflow">while</span>(0)
</pre></div>
<p>Disassemble buffer pointer into a pixel and separate RGBA values. </p>

<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8h_source.html#l00106">106</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8h_source.html">SDL_gfxBlitFunc.h</a>.</p>

</div>
</div>
<a class="anchor" id="a44c498dca765a515f40eecad8f19aac4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="_s_d_l__gfx_blit_func_8h.html#a44c498dca765a515f40eecad8f19aac4">GFX_DUFFS_LOOP4</a></td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">pixel_copy_increment, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">width&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ <span class="keywordtype">int</span> n = (width+3)/4;                                                  \
        switch (width &amp; 3) {                                            \
        case 0: <span class="keywordflow">do</span> {    pixel_copy_increment;                           \
        case 3:         pixel_copy_increment;                           \
        case 2:         pixel_copy_increment;                           \
        case 1:         pixel_copy_increment;                           \
        } <span class="keywordflow">while</span> ( --n &gt; 0 );                                    \
        }                                                               \
        }
</pre></div>
<p>4-times unrolled DUFFs loop. </p>
<p>This is a very useful loop for optimizing blitters. </p>

<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8h_source.html#l00150">150</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8h_source.html">SDL_gfxBlitFunc.h</a>.</p>

</div>
</div>
<a class="anchor" id="a64927ca5690904716f7ac93b1fcd4420"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="_s_d_l__gfx_blit_func_8h.html#a64927ca5690904716f7ac93b1fcd4420">GFX_PIXEL_FROM_RGBA</a></td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">pixel, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">fmt, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">r, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">g, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{                                                                       \
        pixel = ((r&gt;&gt;fmt-&gt;Rloss)&lt;&lt;fmt-&gt;Rshift)|                         \
        ((g&gt;&gt;fmt-&gt;Gloss)&lt;&lt;fmt-&gt;Gshift)|                         \
        ((b&gt;&gt;fmt-&gt;Bloss)&lt;&lt;fmt-&gt;Bshift)|                         \
        ((a&lt;&lt;fmt-&gt;Aloss)&lt;&lt;fmt-&gt;Ashift);                         \
        }
</pre></div>
<p>Wrap a pixel from RGBA values using mask, shift and loss for surface. </p>

<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8h_source.html#l00116">116</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8h_source.html">SDL_gfxBlitFunc.h</a>.</p>

</div>
</div>
<a class="anchor" id="ae6b2c815be86ad92310efb40d4b0b30e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="_s_d_l__gfx_blit_func_8h.html#ae6b2c815be86ad92310efb40d4b0b30e">GFX_RGBA_FROM_PIXEL</a></td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">pixel, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">fmt, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">r, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">g, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{                                                                       \
        r = ((pixel&amp;fmt-&gt;Rmask)&gt;&gt;fmt-&gt;Rshift)&lt;&lt;fmt-&gt;Rloss;              \
        g = ((pixel&amp;fmt-&gt;Gmask)&gt;&gt;fmt-&gt;Gshift)&lt;&lt;fmt-&gt;Gloss;              \
        b = ((pixel&amp;fmt-&gt;Bmask)&gt;&gt;fmt-&gt;Bshift)&lt;&lt;fmt-&gt;Bloss;              \
        a = ((pixel&amp;fmt-&gt;Amask)&gt;&gt;fmt-&gt;Ashift)&lt;&lt;fmt-&gt;Aloss;              \
        }
</pre></div>
<p>Unwrap RGBA values from a pixel using mask, shift and loss for surface. </p>

<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8h_source.html#l00095">95</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8h_source.html">SDL_gfxBlitFunc.h</a>.</p>

</div>
</div>
<a class="anchor" id="a8fcea397327309f4ab31a3251f15f911"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="_s_d_l__gfx_blit_func_8h.html#a8fcea397327309f4ab31a3251f15f911">SDL_GFXBLITFUNC_SCOPE</a>&#160;&#160;&#160;extern</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8h_source.html#l00059">59</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8h_source.html">SDL_gfxBlitFunc.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ab49c560e89b8305051b2e6b347215f03"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#a8fcea397327309f4ab31a3251f15f911">SDL_GFXBLITFUNC_SCOPE</a> int <a class="el" href="_s_d_l__gfx_blit_func_8h.html#ab49c560e89b8305051b2e6b347215f03">SDL_gfxBlitRGBA</a> </td>
          <td>(</td>
          <td class="paramtype">SDL_Surface *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">SDL_Rect *&#160;</td>
          <td class="paramname"><em>srcrect</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">SDL_Surface *&#160;</td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">SDL_Rect *&#160;</td>
          <td class="paramname"><em>dstrect</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Blitter for RGBA-&gt;RGBA blits with alpha adjustment. </p>
<p>Verifies the input 'src' and 'dst' surfaces and rectangles and performs blit. The destination clip rectangle is honored.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>The source surface. </td></tr>
    <tr><td class="paramname">srcrect</td><td>The source rectangle. </td></tr>
    <tr><td class="paramname">dst</td><td>The destination surface. </td></tr>
    <tr><td class="paramname">dstrect</td><td>The destination rectangle.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Returns 1 if blit was performed, 0 otherwise, or -1 if an error occured. </dd></dl>

<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html#l00411">411</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html">SDL_gfxBlitFunc.c</a>.</p>

</div>
</div>
<a class="anchor" id="a7c93594525ae349b5cef0156b8f758fc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#a8fcea397327309f4ab31a3251f15f911">SDL_GFXBLITFUNC_SCOPE</a> int <a class="el" href="_s_d_l__gfx_blit_func_8h.html#a7c93594525ae349b5cef0156b8f758fc">SDL_gfxMultiplyAlpha</a> </td>
          <td>(</td>
          <td class="paramtype">SDL_Surface *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Uint8&#160;</td>
          <td class="paramname"><em>a</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Multiply the alpha channel in a 32bit surface. </p>
<p>Helper function that multiplies the alpha channel in a 32 bit surface with a constant value. The final alpha is always scaled to the range 0-255 (i.e. the factor is a/256).</p>
<p>Only 32 bit surfaces can be used with this function.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Pointer to the target surface to change. </td></tr>
    <tr><td class="paramname">a</td><td>The alpha value to multiply with. When a is 255, this function is a NoOp.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Returns 1 if alpha was changed, 0 otherwise. Returns -1 if input surface is invalid. </dd></dl>

<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html#l00587">587</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html">SDL_gfxBlitFunc.c</a>.</p>

</div>
</div>
<a class="anchor" id="a4627ae4a0037d0b248bed87f3c294735"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_s_d_l__gfx_blit_func_8h.html#a8fcea397327309f4ab31a3251f15f911">SDL_GFXBLITFUNC_SCOPE</a> int <a class="el" href="_s_d_l__gfx_blit_func_8h.html#a4627ae4a0037d0b248bed87f3c294735">SDL_gfxSetAlpha</a> </td>
          <td>(</td>
          <td class="paramtype">SDL_Surface *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Uint8&#160;</td>
          <td class="paramname"><em>a</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the alpha channel in a 32 bit surface. </p>
<p>Helper function that sets the alpha channel in a 32 bit surface to a constant value. Only 32 bit surfaces can be used with this function.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Pointer to the target surface to change. </td></tr>
    <tr><td class="paramname">a</td><td>The alpha value to set.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Returns 1 if alpha was changed, -1 otherwise. </dd></dl>

<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html#l00524">524</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html">SDL_gfxBlitFunc.c</a>.</p>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="a6d0c17342154e14322a281603960691a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const unsigned int <a class="el" href="_s_d_l__gfx_blit_func_8h.html#a6d0c17342154e14322a281603960691a">GFX_ALPHA_ADJUST_ARRAY</a>[256]</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Alpha adjustment table for custom blitter. </p>
<p>The table provides values for a modified, non-linear transfer function which maintain brightness. </p>

<p>Definition at line <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html#l00039">39</a> of file <a class="el" href="_s_d_l__gfx_blit_func_8c_source.html">SDL_gfxBlitFunc.c</a>.</p>

</div>
</div>
</div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.0
</small></address>

</body>
</html>
